@extends('backstage.layout.master')
@section('title', '角色分配')
@section('style')

@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>
            <li class="active">
                <a href="backstage/administrators/list">管理员列表</a>
            </li>
            <li>
                角色分配
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        角色分配
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal" role="form" action="backstage/administrators/add-role" method="post" enctype="multipart/form-data">
                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                            <input type="hidden" name="id" value="{{$id}}">
                            <div class="form-group {{$errors->first('permission_ids[]')!=""?'has-error':''}}">
                                <div class="col-sm-12">
                                    @foreach($roles as $role)
                                        <div class="col-xs-4">
                                            <input type="checkbox" @if($role->selected == 1) checked @endif name="role_ids[]" value="{{$role->id}}" id="{{$role->id}}"><label for="{{$role->id}}">{{$role->display_name}}</label>
                                        </div>
                                    @endforeach
                                </div>
                            </div>

                            <div class="clearfix form-actions">
                                <div class="col-md-offset-5">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        保存
                                    </button>
                                    &nbsp; &nbsp; &nbsp;
                                    <button class="btn" type="reset">
                                        <i class="icon-undo bigger-110"></i>
                                        重置
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div><!-- /row -->
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div>
@stop
@section('script')
@stop